package com.motong.gongdan.vo.system.device.vo;

import com.motong.gongdan.entity.DeviceInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.util.StringUtils;


@Data
@ApiModel("设备数据")
@Accessors(chain = true)
public class DeviceDataVo {

    @ApiModelProperty("设备sn")
    private String deviceSn;

    @ApiModelProperty("设备状态(0 关闭,1 运行中, 2 等待, 3 故障)")
    private String deviceStatus;

    @ApiModelProperty("蓝灯状态(0 关闭,2 呼叫)")
    private String lampBStatus;

    @ApiModelProperty("设备数量")
    private String deviceCount;

    @ApiModelProperty("异常时灯的颜色(0 黄色, 1 红色)")
    private String exceptionLampColor;

    @ApiModelProperty("原因(对应红/黄异常愿意前n个)")
    private String cause;

    @ApiModelProperty("蜂鸣器状态(0 关闭, 1 鸣叫)")
    private String bU;

    @ApiModelProperty("信号状态值(15以上好)")
    private String cSQ;

    @ApiModelProperty("设备信息")
    private DeviceInfo deviceInfo;

    @ApiModelProperty("关机状态")
    private boolean closeStatus = true;

    public boolean checkIsAllNull() {
        return !StringUtils.hasLength(deviceStatus) && !StringUtils.hasLength(cause) && !StringUtils.hasLength(deviceCount) && !StringUtils.hasLength(lampBStatus);
    }

}
